package demo3;
//六、Java类与对象
class Doganimal{
    public String name;
    public int age;
    public void eat(){
        System.out.println(this.name+"吃狗粮");
    }
}
public class Test5 {
    public static void main1(String[] args) {
        Doganimal dog=new Doganimal();
        dog.eat();//可以不初始化，因为有默认值
    }
}
